package com.google.code.japndroid;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

public class PacketKillerWiFiReciever extends BroadcastReceiver {
	
	@Override
	public void onReceive(Context context, Intent intent) {
        Bundle extras = intent.getExtras();
        boolean enable = true;
        if (extras != null) {
        	enable = extras.getBoolean("enable");
        }else{
            boolean isWifiConnectedOrConnecting = PacketKillerUtils.isWifiConnectedOrConnecting(context);
        	enable = (isWifiConnectedOrConnecting ? false : true);
        }
        PacketKillerUtils.setEnableWifi(context,enable);
        
        /*
        Intent msg = new Intent("android.net.wifi.WIFI_STATE_CHANGED");
        msg.putExtra("enable",enable);
        context.sendBroadcast(msg);  
        
        msg = new Intent(PacketKillerConstants.WIFI_STATUS_CHANGE_DONE);
        msg.putExtra("enable",enable);
        context.sendBroadcast(msg);  
        */
	}
}
